package com.hongguan.oms.service.gis;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Service;

import com.hongguan.oms.domain.gis.GisInfo;
import com.hongguan.oms.service.BaseService;

/**
 * @author JimmyLee
 *
 * @createDate 2010-1-5
 *
 */
@Service
public class GisService extends BaseService<GisInfo>{
	
	public GisService(){
		namespace = "GIS_INFO";
	}
	public Long saveOrUpdateGis(GisInfo gisInfo){
		if(gisInfo.getId() == null || gisInfo.getId() <= 0)
			return (Long)getSqlMapClientTemplate().insert("GIS_INFO.saveGis", gisInfo);
		else{
			getSqlMapClientTemplate().update("GIS_INFO.updateGis", gisInfo);
			return gisInfo.getId();
		}
		
	}
	
	public GisInfo getGisInfo(Long id){
		return (GisInfo) getSqlMapClientTemplate().queryForObject("GIS_INFO.getGisInfo", id);
	}
	
	public void deleteGisInfoById(Long id){
		getSqlMapClientTemplate().delete("GIS_INFO.deleteGisInfoById", id);
	}
	public List searchGisById(Map param){
		return this.getSqlMapClientTemplate().queryForList("GIS_INFO.gis_search_by_id", param);
	}
	public long addGis(Map param){
		return (Long)this.getSqlMapClientTemplate().insert("GIS_INFO.gis_add",param);
	}
	public void modifyGis(Map param){
		this.getSqlMapClientTemplate().update("GIS_INFO.gis_modify",param);
	}
}
